package com.jlcindia.jsf;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean(name="userBean")
@SessionScoped
public class userBean {
	
	private String username="amit";
	private String password;
	private String errmsg;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getErrmsg() {
		return errmsg;
	}
	public void setErrmsg(String errmsg) {
		this.errmsg = errmsg;
	}
	
	
	public String verifyuser()
	{
		String result=null;
		if(username.equals(password))
		{
			result="home";
		}
		else
		{
			result="login";
			errmsg="Invalid username or password";
		}
		return result;
	}
	
	public String gotologin()
	{
		errmsg="";
		//username="srinivas";
		return "login";
	}

}
